package cn.gson.work.model.pojos;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.sql.Time;
import java.util.Objects;

@Entity
public class Driver {
    private long driverId;
    private String driverName;
    private String driverAge;
    private String driverSex;
    private Time driverTime;
    private String driverRemark;

    @Id
    @Column(name = "DRIVER_ID")
    public long getDriverId() {
        return driverId;
    }

    public void setDriverId(long driverId) {
        this.driverId = driverId;
    }

    @Basic
    @Column(name = "DRIVER_NAME")
    public String getDriverName() {
        return driverName;
    }

    public void setDriverName(String driverName) {
        this.driverName = driverName;
    }

    @Basic
    @Column(name = "DRIVER_AGE")
    public String getDriverAge() {
        return driverAge;
    }

    public void setDriverAge(String driverAge) {
        this.driverAge = driverAge;
    }

    @Basic
    @Column(name = "DRIVER_SEX")
    public String getDriverSex() {
        return driverSex;
    }

    public void setDriverSex(String driverSex) {
        this.driverSex = driverSex;
    }

    @Basic
    @Column(name = "DRIVER_TIME")
    public Time getDriverTime() {
        return driverTime;
    }

    public void setDriverTime(Time driverTime) {
        this.driverTime = driverTime;
    }

    @Basic
    @Column(name = "DRIVER_REMARK")
    public String getDriverRemark() {
        return driverRemark;
    }

    public void setDriverRemark(String driverRemark) {
        this.driverRemark = driverRemark;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Driver driver = (Driver) o;
        return driverId == driver.driverId &&
                Objects.equals(driverName, driver.driverName) &&
                Objects.equals(driverAge, driver.driverAge) &&
                Objects.equals(driverSex, driver.driverSex) &&
                Objects.equals(driverTime, driver.driverTime) &&
                Objects.equals(driverRemark, driver.driverRemark);
    }

    @Override
    public int hashCode() {
        return Objects.hash(driverId, driverName, driverAge, driverSex, driverTime, driverRemark);
    }
}
